using System.Text;
using System.Runtime.InteropServices;
using System;

/* K: Gen_BuffKey() <BuffKeyGenerator>
 * B: Gen_BuffAssets() <AssetsManager>
 * G: Generate MainFrame <MainFrame>
 * X/C: register a test buff <BuffManager>
 */

public static class XMLAttri
{
    public const string ComponentType = "componentType";
    public const string OccupantKey = "occupantKey";
    public const string OccupantType = "occupantType";
    public const string Tag = "tag";
    public const string TriggerType = "triggerType";
    public const string Pattern = "pattern";
    public const string Duration = "duration";
    public const string BuffName = "buffName";
    public const string NodeKey = "nodeKey";
}

public static class BuffName
{
    public const string TestBuff = "TestBuff";
    public const string SlowDown = "SlowDown";
}

public static class ObjectTag
{
    public const string Mainframe = "MainFrame";
}

public static class ConstValue
{
    public const int Scale = 1000;
}

public static class CommonProgram
{
    private static StringBuilder Gen_OccupantKey(object occupant)
    {
        GCHandle GCHandle = GCHandle.Alloc(occupant, GCHandleType.Pinned);
        //IntPtr address = GCHandle.AddrOfPinnedObject();
        IntPtr address = GCHandle.ToIntPtr(GCHandle);
        return new StringBuilder("0X" + address.ToString("X"));
    }
}

